<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "App",
  computed: {
    //判断是否登录 返回值为token
    isLogin() {
      return this.$store.getters["user/isLogin"];
    },
  },
  created() {
    //动态路由判断登录
    if (this.isLogin) {
      this.$store.commit("addAuthRouter");
    }
  },
};
</script>

<style>
body {
  margin: 0;
  padding: 0;
}
.el-main {
  padding: 0 !important;
}
</style>
